package datatypes;

import java.awt.BasicStroke;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.RenderingHints;

import Gui.TriangleDisplay;

public class Circle {

	public Vertex center;
	public double radius;
	
	public Circle(Vertex center, double radius) {
		this.center = center;
		this.radius = radius;
	}
	
	public void draw(Graphics graphics, TriangleDisplay c) {
		// nb.: do not make permanent changes to the passed-in Graphics object!
		Graphics2D g = (Graphics2D) graphics.create();
		g.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);
		
		g.setColor(Color.gray);
		float dash[] = { 5.0f };
		g.setStroke(new BasicStroke(0.5f, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER, 10.0f, dash, 0.0f));
		int diameter = (int) (radius*2);
		g.drawOval((int)(center.getX()-radius), (int)(center.getY()-radius), diameter, diameter);
	}
}
